package com.itheima.day08.myTreeSet.test4;

import java.util.TreeSet;

public class Test {
    public static void main(String[] args) {
        TreeSet<Teacher> treeSet = new TreeSet<>();
        Teacher tea1 = new Teacher("zhangsan",25);
        Teacher tea2 = new Teacher("wangwu",23);
        Teacher tea3 = new Teacher("zhangsi",25);
        Teacher tea4 = new Teacher("zhaoliu",21);
        Teacher tea5 = new Teacher("zhangsan",25);
        treeSet.add(tea1);
        treeSet.add(tea2);
        treeSet.add(tea3);
        treeSet.add(tea4);
        treeSet.add(tea5);
        for (Teacher teacher : treeSet) {
            System.out.println(teacher);
        }

    }
}
